/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rs_GUI;

import java.awt.Component;
import java.awt.Container;
import javax.swing.JComboBox;
import javax.swing.JTextField;

/**
 *
 * @author KATERINA
 */
public class Wach {
    //Η wach απενεργοποιεί την εισαγωγή directory χειροκίνητα από το χρήστη
    static void watch(Container c) {
        int n = c.getComponentCount();
        for (int i = 0; i < n; i++) {
            Component ch = c.getComponent(i);
            if (ch instanceof Container) {
                Container child = (Container) ch;
                if (child instanceof JTextField) {
                    child.setEnabled(false);
                } 
                if(child instanceof JComboBox){
                       child.setEnabled(false);
                }
                else {
                    watch(child);
                }
            }
        }
    }
}
